<?php
require_once('libraries/pagination.php');

$id = intval($_GET['id']);
$article = get_a_record('articles', $id);

if (!$article) {
    header('HTTP/1.1 Not Found 404', true, 404);
    require('404.php');
    exit();
}

$title = $article['name'];
$categories = get_all('categories', array(
    'order_by' => 'position ASC'
));


$_content = 'frontend/views/articles/detail.phtml';
require('frontend/views/common/layout.phtml');